cmake_minimum_required(VERSION 3.27)
project(FFmpegDemo)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_COMPILER "g++")

# 导入 FFMPEG 库
set(FFMPEG_CODEC ${PROJECT_SOURCE_DIR}/lib/libavcodec.61.19.100.dylib)
set(FFMPEG_DEVICE ${PROJECT_SOURCE_DIR}/lib/libavdevice.61.3.100.dylib)
set(FFMPEG_FILTER ${PROJECT_SOURCE_DIR}/lib/libavfilter.10.4.100.dylib)
set(FFMPEG_FORMAT ${PROJECT_SOURCE_DIR}/lib/libavformat.61.7.100.dylib)
set(FFMPEG_UTIL ${PROJECT_SOURCE_DIR}/lib/libavutil.59.39.100.dylib)
set(FFMPEG_POST_PROC ${PROJECT_SOURCE_DIR}/lib/libpostproc.58.3.100.dylib)
set(FFMPEG_SAMPLE ${PROJECT_SOURCE_DIR}/lib/libswresample.5.3.100.dylib)
set(FFMPEG_SCALE ${PROJECT_SOURCE_DIR}/lib/libswscale.8.3.100.dylib)
set(SDL2 ${PROJECT_SOURCE_DIR}/lib/libSDL2-2.0.0.dylib)
link_libraries(
        ${FFMPEG_CODEC}
        ${FFMPEG_DEVICE}
        ${FFMPEG_FILTER}
        ${FFMPEG_FORMAT}
        ${FFMPEG_UTIL}
        ${FFMPEG_SAMPLE}
        ${FFMPEG_SCALE}
        ${FFMPEG_POST_PROC}
        ${SDL2}
)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/include)
file(GLOB SRC main.cpp "src/*.cpp" "src/*.h"  "src/*.c")
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
add_executable(FFmpegDemo ${SRC})
